<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Block Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__dmac__block__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Block Functions<div class="ingroups"><a class="el" href="group__group__dmac.html">DMAC         (Direct Memory Access Controller)</a> &raquo; <a class="el" href="group__group__dmac__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga3f45f389340c3282c59d6ffe6e5040b5"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__dmac__block__functions.html#ga3f45f389340c3282c59d6ffe6e5040b5">Cy_DMAC_Enable</a> (DMAC_Type *base)</td></tr>
<tr class="memdesc:ga3f45f389340c3282c59d6ffe6e5040b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the DMACblock.  <a href="#ga3f45f389340c3282c59d6ffe6e5040b5">More...</a><br /></td></tr>
<tr class="separator:ga3f45f389340c3282c59d6ffe6e5040b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga326f150b8c5856c36bf2f19672c03a71"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__dmac__block__functions.html#ga326f150b8c5856c36bf2f19672c03a71">Cy_DMAC_Disable</a> (DMAC_Type *base)</td></tr>
<tr class="memdesc:ga326f150b8c5856c36bf2f19672c03a71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the DMACblock.  <a href="#ga326f150b8c5856c36bf2f19672c03a71">More...</a><br /></td></tr>
<tr class="separator:ga326f150b8c5856c36bf2f19672c03a71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga447c513c25c23543cd578f2101d138ad"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__dmac__block__functions.html#ga447c513c25c23543cd578f2101d138ad">Cy_DMAC_GetActiveChannel</a> (DMAC_Type const *base)</td></tr>
<tr class="memdesc:ga447c513c25c23543cd578f2101d138ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the status of the active/pending channels of the DMACblock.  <a href="#ga447c513c25c23543cd578f2101d138ad">More...</a><br /></td></tr>
<tr class="separator:ga447c513c25c23543cd578f2101d138ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga3f45f389340c3282c59d6ffe6e5040b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3f45f389340c3282c59d6ffe6e5040b5">&#9670;&nbsp;</a></span>Cy_DMAC_Enable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_DMAC_Enable </td>
          <td>(</td>
          <td class="paramtype">DMAC_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the DMACblock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware DMAC block.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">    #define DATA_COUNT (8UL)</span></div><div class="line">    <span class="comment">/* Scenario: Initialize a 1D descriptor */</span></div><div class="line">    <a class="code" href="structcy__stc__dmac__descriptor__t.html">cy_stc_dmac_descriptor_t</a> descriptor;</div><div class="line">    <a class="code" href="structcy__stc__dmac__descriptor__t.html">cy_stc_dmac_descriptor_t</a> nextDescriptor;</div><div class="line">    uint32_t src[DATA_COUNT];</div><div class="line">    uint32_t dst[DATA_COUNT];</div><div class="line">    </div><div class="line">    <a class="code" href="structcy__stc__dmac__descriptor__config__t.html">cy_stc_dmac_descriptor_config_t</a> descriptor_cfg = </div><div class="line">    {</div><div class="line">        .<a class="code" href="structcy__stc__dma__descriptor__config__t.html#afcc039279bc1e7d50b0813778772f3c0">retrigger</a> = <a class="code" href="group__group__dmac__enums.html#gga016be77931e116644c70e934101dd7c3ab796353bb8bb6f244bb8f6d94d002396">CY_DMAC_RETRIG_IM</a>,</div><div class="line">        .interruptType = <a class="code" href="group__group__dmac__enums.html#gga78bb44cea66b230aadd012c5bae864a3a274e048caf530edf7ef6159face7c486">CY_DMAC_DESCR</a>,</div><div class="line">        .triggerOutType = <a class="code" href="group__group__dmac__enums.html#gga78bb44cea66b230aadd012c5bae864a3a274e048caf530edf7ef6159face7c486">CY_DMAC_DESCR</a>,</div><div class="line">        .channelState = <a class="code" href="group__group__dmac__enums.html#gga0e57c8ab013d71005b81e60c2c4ee7a9acbff6554ce23780e0fcf2af9e97816cc">CY_DMAC_CHANNEL_ENABLED</a>,</div><div class="line">        .triggerInType = <a class="code" href="group__group__dmac__enums.html#gga78bb44cea66b230aadd012c5bae864a3a274e048caf530edf7ef6159face7c486">CY_DMAC_DESCR</a>,</div><div class="line">        .dataSize = <a class="code" href="group__group__dmac__enums.html#ggac2fda05300faa05ecfc118f22ed2a3c5ad4112bd05bdc21a993b63b0957bfacf8">CY_DMAC_WORD</a>,</div><div class="line">        .srcTransferSize = <a class="code" href="group__group__dmac__enums.html#gga678295e9e6a31ad41feab278d0faf4d1a108838a4e9ea224b4a471593b6484471">CY_DMAC_TRANSFER_SIZE_WORD</a>,</div><div class="line">        .dstTransferSize = <a class="code" href="group__group__dmac__enums.html#gga678295e9e6a31ad41feab278d0faf4d1a108838a4e9ea224b4a471593b6484471">CY_DMAC_TRANSFER_SIZE_WORD</a>,</div><div class="line">        .descriptorType = <a class="code" href="group__group__dmac__enums.html#ggafc067b535081b9cd83fa29b9e68b002ca700cc18061eb5de2f16f3dc1ee96fbe8">CY_DMAC_1D_TRANSFER</a>,</div><div class="line">        .srcAddress = &amp;src,</div><div class="line">        .dstAddress = &amp;dst,</div><div class="line">        .srcXincrement = 1U,</div><div class="line">        .dstXincrement = 1U,</div><div class="line">        .xCount = DATA_COUNT,</div><div class="line">        .srcYincrement = 0U,</div><div class="line">        .dstYincrement = 0U,</div><div class="line">        .yCount = 1UL,</div><div class="line">        .nextDescriptor = &amp;nextDescriptor,</div><div class="line">    };</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__dmac__enums.html#gga67fe9048608517c9cdebbe0372866eb5a5c4b9c1a66c7776ddc98a5b3dedac160">CY_DMAC_SUCCESS</a> != <a class="code" href="group__group__dmac__descriptor__functions.html#gad4204ef079b02d9afdd9328f0cd461f9">Cy_DMAC_Descriptor_Init</a>(&amp;descriptor, &amp;descriptor_cfg))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line">    </div><div class="line">    <span class="comment">/* Scenario: Setup and enable the DMAC channel 0 */</span></div><div class="line">    <a class="code" href="structcy__stc__dmac__channel__config__t.html">cy_stc_dmac_channel_config_t</a> channelConfig;</div><div class="line">    channelConfig.<a class="code" href="structcy__stc__dmac__channel__config__t.html#a01cab162709493ed756b6cb21219ff51">enable</a> = <span class="keyword">false</span>;</div><div class="line">    channelConfig.<a class="code" href="structcy__stc__dmac__channel__config__t.html#ade9585ff561af6ad292932293e0bd15d">bufferable</a> = <span class="keyword">false</span>;</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__dmac__enums.html#gga67fe9048608517c9cdebbe0372866eb5a5c4b9c1a66c7776ddc98a5b3dedac160">CY_DMAC_SUCCESS</a> != <a class="code" href="group__group__dmac__channel__functions.html#ga7b508e6cc332b4d009bf9b09ed6529b3">Cy_DMAC_Channel_Init</a>(DMAC, 0UL, &amp;channelConfig))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line">    </div><div class="line">    <a class="code" href="group__group__dmac__channel__functions.html#ga0ea7589df07e40e6723dc7f992e6994b">Cy_DMAC_Channel_SetDescriptor</a>(DMAC, 0UL, &amp;descriptor);</div><div class="line">    <a class="code" href="group__group__dmac__channel__functions.html#ga4e68ab04d5de2d6a1b31779741aa64db">Cy_DMAC_Channel_SetPriority</a>(DMAC, 0UL, 3UL);</div><div class="line">    <a class="code" href="group__group__dmac__channel__functions.html#gab39e11c3ad72ebfd07cdd9840385769b">Cy_DMAC_Channel_Enable</a>(DMAC, 0UL);</div><div class="line">    </div><div class="line">    <a class="code" href="group__group__dmac__block__functions.html#ga3f45f389340c3282c59d6ffe6e5040b5">Cy_DMAC_Enable</a>(DMAC);</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (<span class="keyword">true</span> != <a class="code" href="group__group__dmac__channel__functions.html#ga4423c4dbc11bb51cb622e95fb593ee9c">Cy_DMAC_Channel_IsEnabled</a>(DMAC, 0UL))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga326f150b8c5856c36bf2f19672c03a71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga326f150b8c5856c36bf2f19672c03a71">&#9670;&nbsp;</a></span>Cy_DMAC_Disable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_DMAC_Disable </td>
          <td>(</td>
          <td class="paramtype">DMAC_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the DMACblock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware DMAC block.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    </div><div class="line">    <span class="comment">/* Scenario: Disable the DMAC channel 0 if it&#39;s priority equals 3 */</span></div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (3UL == <a class="code" href="group__group__dmac__channel__functions.html#gafc275a614e5307f13e86a1d0c07e0af5">Cy_DMAC_Channel_GetPriority</a>(DMAC, 0UL))</div><div class="line">    {    </div><div class="line">        <span class="keywordflow">if</span> (0UL != <a class="code" href="group__group__dmac__block__functions.html#ga447c513c25c23543cd578f2101d138ad">Cy_DMAC_GetActiveChannel</a>(DMAC))</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__dmac__channel__functions.html#gae46d7a93ef597de25a50159b615fcaf1">Cy_DMAC_Channel_Disable</a>(DMAC, 0UL);</div><div class="line">            <a class="code" href="group__group__dmac__channel__functions.html#gaac669d8281a624e28c436e7ff8588ac3">Cy_DMAC_Channel_DeInit</a>(DMAC, 0UL);</div><div class="line"></div><div class="line">            <span class="comment">/* if needed (if there is only channel used) the whole block can be disabled */</span></div><div class="line">            <a class="code" href="group__group__dmac__block__functions.html#ga326f150b8c5856c36bf2f19672c03a71">Cy_DMAC_Disable</a>(DMAC);</div><div class="line">        }</div><div class="line">    }</div><div class="line">    </div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga447c513c25c23543cd578f2101d138ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga447c513c25c23543cd578f2101d138ad">&#9670;&nbsp;</a></span>Cy_DMAC_GetActiveChannel()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_DMAC_GetActiveChannel </td>
          <td>(</td>
          <td class="paramtype">DMAC_Type const *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the status of the active/pending channels of the DMACblock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware DMAC block.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a bit-field with all of the currently active/pending channels in the DMAC block.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    </div><div class="line">    <span class="comment">/* Scenario: Disable the DMAC channel 0 if it&#39;s priority equals 3 */</span></div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (3UL == <a class="code" href="group__group__dmac__channel__functions.html#gafc275a614e5307f13e86a1d0c07e0af5">Cy_DMAC_Channel_GetPriority</a>(DMAC, 0UL))</div><div class="line">    {    </div><div class="line">        <span class="keywordflow">if</span> (0UL != <a class="code" href="group__group__dmac__block__functions.html#ga447c513c25c23543cd578f2101d138ad">Cy_DMAC_GetActiveChannel</a>(DMAC))</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__dmac__channel__functions.html#gae46d7a93ef597de25a50159b615fcaf1">Cy_DMAC_Channel_Disable</a>(DMAC, 0UL);</div><div class="line">            <a class="code" href="group__group__dmac__channel__functions.html#gaac669d8281a624e28c436e7ff8588ac3">Cy_DMAC_Channel_DeInit</a>(DMAC, 0UL);</div><div class="line"></div><div class="line">            <span class="comment">/* if needed (if there is only channel used) the whole block can be disabled */</span></div><div class="line">            <a class="code" href="group__group__dmac__block__functions.html#ga326f150b8c5856c36bf2f19672c03a71">Cy_DMAC_Disable</a>(DMAC);</div><div class="line">        }</div><div class="line">    }</div><div class="line">    </div></div><!-- fragment --></dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
